<template>
  <el-menu :default-active="activeIndex" class="navi-menu" mode="horizontal" @select="handleSelect">
    <div class="navi-menu-left-zone">
      <logo class="menu-logo"></logo>
      <el-menu-item index="menu-home" class="menu-home">首页</el-menu-item>
    </div>

    <div class="navi-menu-right-zone">
      <el-menu-item v-if="!isLogin" index="menu-home" class="menu-login">登陆/注册</el-menu-item>
      <el-submenu v-if="isLogin" index="menu-project" class="menu-profile">
        <template slot="title">头像+用户名</template>
        <el-menu-item index="2-1">注销</el-menu-item>
      </el-submenu>
    </div>

  </el-menu>
</template>

<script>
import Logo from "@/components/common/logo";

export default {
  name: "Navigation",
  components: {Logo},
  data() {
    return {
      activeIndex: '1',
      isLogin: false,
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style scoped>
.navi-menu {
  width: 100vw;
}

.navi-menu-left-zone {
  margin-left: 10vw;
  float: left;
  display: flex;
  justify-content: center;
}

.navi-menu-right-zone {
  margin-right: 10vw;
  float: right;
}

.menu-logo {
  width: 100px;
  height: 55px;
  float: left;
}
</style>